import { http } from "@/utils/http";

export type UserInfo = {
  /** 用户名 */
  name: string;
  id?: string;

  ct?: string;
  ut?: string;
};

/** 登录 */
export const getLogin = (data?: object) => {
  return http.request<Object>("post", "/api/user/login", { data });
};

/** 获取密保信息 */
export const apiGetSecretSecurity = (data?: object) => {
  return http.request<Object>("post", "/api/user/getSecretSecurity", { data });
};

/** 注册 */
export const apiEnroll = (data?: object) => {
  return http.request<Object>("post", "/api/user/register", { data });
};

/** 更新用户信息 */
export const apiEditUser = (data?: object) => {
  return http.request<Object>("put", "/api/user/editUser", { data });
};

/** 更新用户密码 */
export const apiEditPassword = (data?: object) => {
  return http.request<Object>("put", "/api/user/editPassword", { data });
};